home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / text / tex / tgrind.lha / TGrind / tgrind.man (.txt) < prev    next >
LaTeX Document  |  1993-01-04  |  4KB  |  106 lines

  1.                                                         TGRIND(1)
  2.      tgrind - grind nice program listings using TeX
  3. SYNOPSIS
  4.      tgrind [ -f ] [ - ] [ -n ] [ -h header ] [ -d <description
  5.      file> ] [ -l<language> ] name ...
  6. DESCRIPTION
  7.      
  8. [1mTgrind
  9. [0m formats program sources in a nice style using 
  10. [1mTeX(1)
  11.      Comments are placed in italics, keywords in bold face and
  12.      strings in typewriter font.  Source file line numbers appear
  13.      in the right margin (every 10 lines).  The start of a func-
  14.      tion is indicated by the function name in large type in the
  15.      right margin.
  16.      In regular mode 
  17. [1mtgrind
  18. [0m processes its input file(s) and
  19.      passes them to 
  20. [1mTeX(1)
  21. [0m for formatting and output.
  22.      In format mode (i.e., when the -f flag is used), 
  23. [1mtgrind
  24.      processes its input file(s) and writes the result to stan-
  25.      dard output.  This output can be saved for later editing,
  26.      inclusion in a larger document, etc.
  27.      The options are:
  28.      -f   forces format mode
  29.      -    take input from standard input
  30.      -n   don't boldface keywords
  31.      -h   specifies text to go on the left side of every output
  32.           page (default is none)
  33.      -d   specifies the language definitions file (default is
  34.           tex:inputs/tgrindefs)
  35.      -l   specifies the language to use.  Currently known are C
  36.           (-lc or the default), C++ (-lcc), TeX (-ltex), Yacc (-
  37.           ly), Prolog (-lprolog), Icon (-lI), Motorola 68K assem-
  38.           bler (-la68), Pascal (-lp), Modula-2 (-lm2), Ratfor (-
  39.           lr), MODEL (-lm), ISP (-li), arbitrary source (-lsrc),
  40.           CSH (-lcsh), and Bourne Shell (-lsh).
  41. Using Tgrind with LaTex
  42.      Use the -f option to tgrind to produce file(s) of the code
  43.      you want to include in a LaTeX document.  Edit the document
  44.      and add a tgrind option to the \documentstyle command.  Then
  45.      include the formatted code files, wrapping each in a tgrind
  46.      environment (i.e., 
  47. [1m\begin{tgrind}
  48. [0m ... 
  49. [1m\end{tgrind}
  50.                                                                 1
  51. TGRIND(1)
  52.      By default, the tgrind environment produces a vertical list
  53.      of vboxes (use the TeXBook to translate this sentence into
  54.      English).  This is the most flexible format (in particular,
  55.      the TeX page builder will have the freedom to break the code
  56.      across page(s)) but, to handle some common but less flexible
  57.      formats, an option may follow the 
  58. [1m\begin
  59. [1mtgrind
  60. [0m}:
  61.      [c]  Center the code as a block.  This option will also
  62.           prevent the code from being broken across pages.
  63.      [n]  Number the lines.  Every 10th line has a small number
  64.           placed in the right margin (as in the normal tgrind
  65.           output).
  66.      [b]  Box the code.  The code will be enclosed in a 
  67. [1mvbox
  68.           This allows the formatted code to be used in contexts
  69.           where it normally couldn't be.  E.g., math mode, a par-
  70.           box, a vcenter, etc.  This will also prevent the code
  71.           from being broken across pages.
  72. FILES
  73.      tgrindmac.tex           macro package
  74.      tgrind.sty              LaTeX style file
  75.      tex:inputs/tgrindefs    language descriptions
  76. AUTHOR
  77.      Van Jacobson, Lawrence Berkeley Laboratory (based on
  78.      "vgrind" by Dave Presotto & William Joy of UC Berkeley).
  79.      Amiga port by Kari Sutela, University of Turku.
  80. SEE ALSO
  81.      tex(1), vgrind(1), vgrindefs(5)
  82.      The marginal-function-name mechanism depends on the quality
  83.      of the language description in 
  84. [1mtgrindefs
  85. [0m.  The distributed
  86.      
  87. [1mtgrindefs
  88. [0m fails to recognize many legal C function declara-
  89.      tions.
  90.      Arbitrary formatting styles for programs mostly look bad.
  91.      The use of spaces to align source code often fails miserably
  92.      (because of the variable width output font).  If you plan to
  93.      
  94. [1mtgrind
  95. [0m your program, try to use tabs.
  96.      The indexing option of 
  97. [1mvgrind
  98. [0m is missing.  However, nice
  99.      indices can be generated using the -v option of 
  100. [1mctags
  101.      together with appropriate TeX macros.
  102.      The -f flag means different things to 
  103. [1mtgrind
  104. [0m and 
  105. [1mvgrind
  106.